package com.yesun.task.pipeline.common;

import lombok.Data;

@Data
public class Result<T> {

    private Integer code = 0;
    private String msg = "";
    private T data;

    public Result() {
    }

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result setData(T data) {
        this.data = data;
        return this;
    }

    public Result setMsg(String msg) {
        this.msg = msg;
        return this;
    }
    public static Result getSuccess() {
        return new Result(20000, "成功");
    }
    public static Result getFailure() {
        return new Result(40000, "失败");
    }

}
